Skip to content

Add configurable port and directory options for demo command#2

Merged
robdimarco-atxp merged 1 commit intomainfrom
robdimarco/atxp-243-allow-users-to-specify-what-port-and-working-directory-to
Sep 9, 2025
Merged

Add configurable port and directory options for demo command#2
robdimarco-atxp merged 1 commit intomainfrom
robdimarco/atxp-243-allow-users-to-specify-what-port-and-working-directory-to

Conversation

@robdimarco-atxp
Copy link
Contributor

Summary

  • Added configurable port and directory options for the demo command
  • Refactored argument parsing logic from run-demo.ts to index.ts for better separation of concerns
  • Added comprehensive documentation and examples

Changes

  • New option: --port, -p to specify custom demo port (default: 8016)
  • New option: --dir, -d to specify custom demo directory (default: ~/.cache/atxp/demo)
  • Refactored: Moved CLI argument parsing to index.ts
  • Improved: Type safety with DemoOptions interface
  • Updated: Help text and README documentation

New Usage Examples

# Use custom port
npx atxp demo --port 3000

# Use custom directory  
npx atxp demo --dir ./my-demo

# Combine options
npx atxp demo --port 9000 --dir ~/projects/demo --verbose

Test plan

  • npx atxp shows updated help with new options
  • npx atxp demo works with default settings
  • --port option allows custom port specification
  • --dir option allows custom directory specification
  • Path resolution works for relative directories
  • All existing functionality preserved (verbose, refresh flags)
  • TypeScript compilation successful
  • Updated documentation reflects new options

Benefits

  • Resolves port conflicts - Users can avoid port 8016 if occupied
  • Flexible installation - Users can choose demo location
  • Better architecture - Cleaner separation of CLI vs demo logic
  • Type safety - Structured options interface
  • Backward compatible - All existing usage patterns work

Related to ATXP-243: Allow users to specify what port and working directory to use for the demo

🤖 Generated with Claude Code

- Move argument parsing from run-demo.ts to index.ts for better separation of concerns
- Add --port/-p option to specify custom demo port (default: 8016)
- Add --dir/-d option to specify custom demo directory (default: ~/.cache/atxp/demo)
- Refactor runDemo() to accept DemoOptions parameter for type safety
- Update all helper functions to use passed parameters instead of global state
- Add comprehensive documentation in help text and README files
- Support path resolution for relative directory paths

New usage examples:
- npx atxp demo --port 3000
- npx atxp demo --dir ./my-demo
- npx atxp demo --port 9000 --dir ~/projects/demo --verbose

Resolves port conflicts and allows flexible demo installation locations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@linear
Copy link

linear bot commented Sep 9, 2025

@robdimarco-atxp robdimarco-atxp merged commit 724821f into main Sep 9, 2025
1 check passed
@robdimarco-atxp robdimarco-atxp deleted the robdimarco/atxp-243-allow-users-to-specify-what-port-and-working-directory-to branch September 9, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant